﻿using System;
using System.Data;
using System.Linq;
using WPFExcelReport.Helpers;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class ITXEXRPT
    {

        private void JLTBB02(DataSet db)
        {
            try
            {
                DataTable tbWBBST = db.Tables["BABST"];  
                DataTable dtOutput = new DataTable();
                int idx = 1;
                #region======Title===========
                exAgent.SetCellValue(1, idx++, "库"); dtOutput.Columns.Add("BMLO", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "库位"); dtOutput.Columns.Add("BMLB", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "库区"); dtOutput.Columns.Add("BMLP", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "任务书号"); dtOutput.Columns.Add("BMKART", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "色号"); dtOutput.Columns.Add("BMFARBE", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "轴前缀"); dtOutput.Columns.Add("BMBAUMKRS", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "轴号"); dtOutput.Columns.Add("BMBAUMLFD", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "轴类型"); dtOutput.Columns.Add("BMKETTTYP", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "目标长度"); dtOutput.Columns.Add("BMSOLLLG", typeof(System.String));
                exAgent.SetCellValue(1, idx++, "实际长度"); dtOutput.Columns.Add("BMRESTLG", typeof(System.String)); 
                #endregion 
                dtOutput.Merge(tbWBBST, false, MissingSchemaAction.Ignore);   
                exAgent.DataTableToExcel(dtOutput, 2, 1); 
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }
         
    }
}